#ifndef ROTATEDLABEL_H
#define ROTATEDLABEL_H

#include <QWidget>
#include <QPixmap>
#include <QLabel>

class RotatedLabel : public QWidget
{
public:
    RotatedLabel(const QString &text, QWidget *parent = 0);
    void setAngle(qreal angle);
    void setText(const QString &text);
    void setAlignment(Qt::Alignment);
    void setBackgroundColor(const QColor &color);

    QSize sizeHint() const;
    QSize minimumSizeHint() const;
    QString text() const;
    qreal angle() const;
    Qt::Alignment alignment() const;
    QColor backgroundColor() const;

    void updateLabel();

protected:
    void paintEvent(QPaintEvent *event);
    void resizeEvent(QResizeEvent *event);

private:
    void updatePixmap();
    qreal _angle;
    QLabel _label;
    QPixmap _pixmap;
    QColor _backgroundColor;
};

#endif // ROTATEDLABEL_H
